home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / ppascal.zip / SIREN.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-24  |  1KB  |  59 lines

  1. program sirensound;
  2. { imitates the sound of a police siren }
  3.  
  4. uses crt;
  5.  
  6. var
  7.   ch:char;
  8.   x,y:integer;
  9.  
  10. begin { program sirensound }
  11.   repeat
  12.     for y:=1 to 2 do
  13.     begin
  14.       for x:=320 to 600 do       { go up slow }
  15.         begin
  16.           sound(x);
  17.           delay(x div 50);
  18.         end;
  19.       delay (200);
  20.  
  21.       for x:=600 downto 320 do   { go down slow }
  22.         begin
  23.           sound(x);
  24.           delay(x div 50);
  25.         end;
  26.     if keypressed then
  27.       begin
  28.         nosound;
  29.         halt(1);
  30.       end;
  31.  
  32.     end;
  33.     for y:=1 to 12 do
  34.     begin
  35.       for x:=160 to 300 do       { go up fast }
  36.         begin
  37.           sound(2*x);
  38.           delay(1);
  39.         end;
  40.       delay (20);
  41.  
  42.       for x:=300 downto 160 do   { go down fast }
  43.         begin
  44.           sound(2*x);
  45.           delay(1);
  46.         end;
  47.       If y = 12 then delay(100);
  48.     if keypressed then
  49.       begin
  50.         nosound;
  51.         halt(1);
  52.       end;
  53.     end;
  54.   until keypressed;
  55.  
  56.  
  57.   nosound;
  58. end. { program sirensound }
  59.